package top.lisicheng.controller;

import com.fasterxml.jackson.core.type.TypeReference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import top.lisicheng.model.CommonResult;
import top.lisicheng.model.Payment;
import top.lisicheng.openfeign.PaymentApi;

import javax.annotation.Resource;

/**
 * @author Lisicheng
 */
@RestController
@Slf4j
@RequestMapping("order")
public class OrderController {

    @Resource
    private PaymentApi paymentApi;

    @GetMapping("get")
    public CommonResult get(Long id) {
        return paymentApi.get(id);
    }

    @RequestMapping("timeout")
    public CommonResult timeout() {
        return paymentApi.timeout();
    }

}
